{% extends 'base.html' %}
{% load i18n %}
{% load sitetags%}

{% block title %}{% trans '时区选择' %}{% endblock %}

{% block body %}
    <div class="d-flex justify-content-center align-items-center h-100 bg-light">
        <div class="card border-0 col-md-8 col-lg-6">
            <div class="card-body">
                <div class="p-2">
                    <div class="input-group mb-3">
                        <p class="font-weight-bold">{% trans '当前时区:' %} {{ current_tz_dispaly }}</p>
                        <p>{% trans '服务有默认时区，服务中的日期时间展示的是默认时区的对应日期时间，用户可以设置自己所在的时区，服务中的日期时间会转换为设置的时区时间进行展示。' %}</p>
                    </div>
                    <form action="{% url 'users:set-timezone' %}" method="post" id="id-language-switcher">
                        <div class="input-group mb-3">
                            <div class="input-group-prepend">
                                <label class="input-group-text" for="timezoneSelect">{% trans '时区' %}</label>
                            </div>
                            <select name="timezone" class="custom-select" id="timezoneSelect">
                                {% for tz in available_tz_choices %}
                                    <option {% if tz.0 == current_tzname %}selected{% endif %}
                                            value="{{ tz.0 }}">{{ tz.1 }}</option>
                                {% endfor %}
                            </select>
                            <div class="input-group-append">
                                <button class="btn btn-outline-primary" type="submit">{% trans '确认' %}</button>
                            </div>
                            {% csrf_token %}
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
{% endblock %}
